package com.indeep.user.vo;

import com.indeep.user.constant.LevelAndExp;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserExpInfoVO {
    /**
     * 是否完善个人信息
     */
    private String isComplete;// "true"
    /**
     * 当前经验值（在等级内）
     */
    private Integer currentExperience;
    /**
     * 数字等级
     */
    private Integer level;
    /**
     * 等级最大经验值+1
     */
    private Integer requiredExperience;

    public UserExpInfoVO(LevelAndExp levelAndExp, boolean isComplete) {
        this.isComplete = isComplete + "";
        this.level = levelAndExp.getLevel().level;
        this.currentExperience = levelAndExp.getTotalExp() - levelAndExp.getLevel().minExp;
        this.requiredExperience = levelAndExp.getLevel().maxExp - levelAndExp.getLevel().minExp + 1;
    }
}
